home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-12-04 | 3.6 KB | 67 lines | [TEXT/MPS ] |
- /*
- * Structure of a tree node.
- */
-
- typedef struct node *nodeptr;
-
- /*
- * Kinds of fields in syntax tree node.
- */
- union field {
- long n_val; /* integer-valued fields */
- char *n_str; /* string-valued fields */
- struct lentry *lsym; /* fields referencing local symbol table entries */
- struct centry *csym; /* fields referencing constant symbol table entries */
- struct implement *ip; /* fields referencing an operation */
- struct pentry *proc; /* pointer to procedure entry */
- struct rentry *rec; /* pointer to record entry */
- unsigned int *typ; /* extra type field */
- nodeptr n_ptr; /* subtree pointers */
- };
-
- /*
- * A store is an array that maps variables types (which are given indexes)
- * to the types stored within the variables.
- */
- struct store {
- struct store *next;
- int perm; /* flag: whether store stays across iterations */
- unsigned int *types[1]; /* actual size is number of variables */
- };
-
- /*
- * Array of parameter types for an operation call.
- */
- struct symtyps {
- int nsyms; /* number of parameter symbols */
- struct symtyps *next;
- unsigned int *types[1]; /* really one for every symbol */
- };
-
- /*
- * definitions for maintaining allocation status.
- */
- #define NotAlloc 0 /* temp var neither in use nor reserved */
- #define InUnse 1 /* temp var currently contains live variable */
- /* n < 0 reserved: must be free by node with postn field = n */
-
- #define DescTmp 1 /* allocation of descriptor temporary */
- #define CIntTmp 2 /* allocation of C integer temporary */
- #define CDblTmp 3 /* allocation of C double temporary */
- #define SBuf 4 /* allocation of string buffer */
- #define CBuf 5 /* allocation of cset buffer */
-
- struct freetmp { /* list of things to free at a node */
- int kind; /* DescTmp, CIntTmp, CDblTmp, SBuf, or CBuf */
- int indx; /* index into status array */
- int old; /* old status */
- struct freetmp *next;
- };
-
- struct node {
- int n_type; /* node type */
- char *n_file; /* name of file containing source program */
- int n_line; /* line number in source program */
- int n_col; /* column number in source program */
- int flag;
- int *new_